@extends('layouts.admin')
@section('title')
    <title>商户菜单添加</title>
@endsection
@section('content')
    @include('layouts.left')
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                商户菜单添加
                <small>Control panel</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                <li class="active">Dashboard</li>
            </ol>
        </section>
        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-offset-2 col-md-8">
                    @if(session('info'))
                        <div class="alert alert-warning alert-dismissible">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <h4><i class="icon fa fa-warning"></i> Alert!</h4>
                            {{ session('info') }}
                        </div>
                    @endif
                    @if(count($errors)>0)
                    <div class="alert alert-danger alert-dismissible">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                        <h4><i class="icon fa fa-ban"></i> 警告</h4>
                        <ul>
                            @foreach($errors -> all() as $error)
                                <li >{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                    @endif
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">快速添加</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="{{ url('smenu') }}" method="post">
                            {{ csrf_field() }}
                            <div class="box-body">
                                <div class="form-group">
                                    <label for="exampleInputEmail1">菜单名称</label>
                                    <input type="text" class="form-control"  required name="name" value="{{old('name')}}"  placeholder="名称">
                                </div>
                                <div class="form-group">
                                    <label>菜单关系</label>
                                    <select class="form-control" name="menu_pid" >
                                        <option value="0">顶级菜单</option>
                                        @foreach($mdatas as $mdata)
                                            <option value="{{ $mdata -> id }}">{{ $mdata -> name }}</option>
                                        @endforeach
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">菜单图标</label>
                                    <input type="text" class="form-control"   name="icon" value="{{old('icon')}}"placeholder="图标" >
                                    <a href="http://adminlte.la998.com/pages/UI/icons.html" target="_blank">参考图标</a>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">菜单uri</label>
                                    <input type="text" class="form-control" name="url"  value="{{old('url')}}" placeholder="网址">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">菜单排序</label>
                                    <input type="text" class="form-control"  required name="sort" value="{{old('url')}}" placeholder="排序">
                                </div>
                            </div>
                            <!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </form>
                    </div>
                    <!-- /.box -->
                </div>
                <!--/.col (left) -->
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <!-- 在这里 写js函数-->
@endsection


